<?php
    class BetalingRepository implements IRepository 
    {
        private $client;

        public function __construct($client)
        {
            $this->client = $client;
        }
        public function Create()
        {
        }
        public function Read()
        {
        }
        public function Update($id)
        {
        }
        public function Delete($id)
        {
        }
        
        public function BetalingVan($id)
        {
            $link = $this->client->connect();
            $query = "SELECT * FROM `betaling`
                    WHERE leerling_id = " . $id . ";";
            $result = mysql_query($query);
            $betalingen = array();
            if($result !== false)
            {
                while($row = mysql_fetch_assoc($result))
                {
                    if(isset($row['id']))
                    {
                        $betalingen[] = $row;
                    }
                }
            }
            else
            {
                echo mysql_error();
            }
            $this->client->close();
            return $betalingen;
        }
    }
?>